/*
 * Copyright (c) 2025 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef INTERFACES_KITS_JS_SRC_COMMON_ANI_HELPER_ANI_SIGNATURE_H
#define INTERFACES_KITS_JS_SRC_COMMON_ANI_HELPER_ANI_SIGNATURE_H

#pragma once

#include <string>
#include <ani_signature_builder.h>

namespace OHOS::FileManagement::ModuleFileIO::ANI::AniSignature {
using namespace std;
using namespace arkts::ani_signature;

struct BasicTypes {
    static const Type undefinedType;
    static const Type nullType;
    static const Type booleanType;
    static const Type byteType;
    static const Type charType;
    static const Type shortType;
    static const Type intType;
    static const Type longType;
    static const Type floatType;
    static const Type doubleType;
};

struct BasicTypesConverter {
    static const string toLong;
    static const string toInt;
    static const string toDouble;
};

struct BaseType {
    static const string ctorDesc;
    static const string ctorSig0;
    static const string ctorSig;
};

namespace BoxedTypes {

struct Boolean : public BaseType {
    static const Type classType;
    static const string classDesc;
    static const string booleanUnboxedDesc;
    static const string booleanUnboxedSig;
};

struct Int : public BaseType {
    static const Type classType;
    static const string classDesc;
    static const string ctorSig;
    static const string toIntDesc;
    static const string toIntSig;
};

struct Long : public BaseType {
    static const Type classType;
    static const string classDesc;
    static const string ctorSig;
    static const string toLongDesc;
    static const string toLongSig;
    static const string getOptionSig;
};

struct Double : public BaseType {
    static const Type classType;
    static const string classDesc;
    static const string toDoubleDesc;
    static const string toDoubleSig;
};

} // namespace BoxedTypes

namespace BuiltInTypes {

struct Object : public BaseType {
    static const Type classType;
    static const string classDesc;
};

inline const Type &objectType = BuiltInTypes::Object::classType;

struct String : public BaseType {
    static const Type classType;
    static const string classDesc;
};

inline const Type &stringType = BuiltInTypes::String::classType;

struct Array : public BaseType {
    static const Type classType;
    static const string classDesc;
    static const string ctorSig;
    static const string getterDesc;
    static const string setterDesc;
    static const string objectGetterSig;
    static const string objectSetterSig;
};

struct ArrayBuffer : public BaseType {
    static const Type classType;
    static const string classDesc;
    static const string ctorSig;
};

struct BigInt : public BaseType {
    static const Type classType;
    static const string classDesc;
    static const string ctorSig;
};

struct BusinessError : public BaseType {
    static const Type classType;
    static const string classDesc;
};

}; // namespace BuiltInTypes

namespace FS {

struct ConflictFilesInner : public BaseType {
    static const Type classType;
    static const string classDesc;
    static const string ctorSig;
};

struct ReadStreamOptions : public BaseType {
    static const Type classType;
};

struct ReadStreamOptionsInner : public BaseType {
    static const Type classType;
    static const string classDesc;
    static const string ctorDesc;
    static const string ctorSig;
};

struct WriteStreamOptions : public BaseType {
    static const Type classType;
};

struct WriteStreamOptionsInner : public BaseType {
    static const Type classType;
    static const string classDesc;
    static const string ctorDesc;
    static const string ctorSig;
};

struct FileInner : public BaseType {
    static const Type classType;
    static const string classDesc;
    static const string ctorSig;
    static const string getFdDesc;
    static const string getFdSig;
    static const string getPathDesc;
    static const string getPathSig;
    static const string getNameDesc;
    static const string getNameSig;
};

struct ProgressInner : public BaseType {
    static const Type classType;
    static const string classDesc;
    static const string ctorSig;
};

struct RandomAccessFileInner : public BaseType {
    static const Type classType;
    static const string classDesc;
    static const string ctorSig;
    static const string getFdDesc;
    static const string getFdSig;
    static const string getFPDesc;
    static const string getFPSig;
};

struct ReaderIteratorInner : public BaseType {
    static const Type classType;
    static const string classDesc;
    static const string ctorSig;
};

struct ReaderIteratorResultInner : public BaseType {
    static const Type classType;
    static const string classDesc;
    static const string ctorSig;
};

struct StatInner : public BaseType {
    static const Type classType;
    static const string classDesc;
    static const string ctorSig;
    static const string getIno;
    static const string getInoSig;
    static const string getMode;
    static const string getModeSig;
    static const string getUid;
    static const string getUidSig;
    static const string getGid;
    static const string getGidSig;
    static const string getSize;
    static const string getSizeSig;
    static const string getAtime;
    static const string getAtimeSig;
    static const string getMtime;
    static const string getMtimeSig;
    static const string getCtime;
    static const string getCtimeSig;
    static const string getAtimeNs;
    static const string getAtimeNsSig;
    static const string getMtimeNs;
    static const string getMtimeNsSig;
    static const string getCtimeNs;
    static const string getCtimeNsSig;
    static const string getLocation;
    static const string getLocationSig;
};

struct StreamInner : public BaseType {
    static const Type classType;
    static const string classDesc;
    static const string ctorSig;
};

struct TaskSignal : public BaseType {
    static const Type classType;
    static const string classDesc;
    static const string ctorDesc;
    static const string ctorSig;
    static const string nativeTaskSignal;
};

struct WatcherInner : public BaseType {
    static const Type classType;
    static const string classDesc;
    static const string ctorSig;
    static const string nativePtr;
};

struct WatchEventInner : public BaseType {
    static const Type classType;
    static const string classDesc;
    static const string ctorSig;
};

struct LocationType : public BaseType {
    static const Type classType;
    static const string classDesc;
};

struct ReadStream : public BaseType {
    static const Type classType;
    static const string classDesc;
    static const string ctorSig;
    static const string ctorSig1;
};

struct WriteStream : public BaseType {
    static const Type classType;
    static const string classDesc;
    static const string ctorSig;
    static const string ctorSig1;
};

struct AtomicFile : public BaseType {
    static const Type classType;
    static const string classDesc;
    static const string ctorSig;
    static const string bindNativePtr;
    static const string bindNativePtrSig;
};

struct CleanerImpl : public BaseType {
    static const Type classType;
    static const string classDesc;
};

struct ReadTextOptions : public BaseType {
    static const Type classType;
    static const string classDesc;
    static const string getOffsetDesc;
    static const string getOffsetSig;
    static const string getLengthDesc;
    static const string getLengthSig;
    static const string getEncodingDesc;
    static const string getEncodingSig;
};

} // namespace FS

namespace Impl {

struct EnvironmentImpl : public BaseType {
    static const Type classType;
    static const string classDesc;
};

struct FileIoImpl : public BaseType {
    static const Type classType;
    static const string classDesc;
};

struct HashImpl : public BaseType {
    static const Type classType;
    static const string classDesc;
};

struct SecurityLabelImpl : public BaseType {
    static const Type classType;
    static const string classDesc;
};

struct StatvfsImpl : public BaseType {
    static const Type classType;
    static const string classDesc;
};

} // namespace Impl

namespace HASH {

struct HashStreamImpl : public BaseType {
    static const Type classType;
    static const string classDesc;
    static const string ctorSig;
    static const string bindNativePtrSig;
};

struct CleanerImpl : public BaseType {
    static const Type classType;
    static const string classDesc;
};

} // namespace HASH

} // namespace OHOS::FileManagement::ModuleFileIO::ANI::AniSignature

#endif // INTERFACES_KITS_JS_SRC_COMMON_ANI_HELPER_ANI_SIGNATURE_H